package homework02;

import java.lang.reflect.Method;
import java.util.ArrayList;

public class Test {
    public static void main(String[] args) throws Exception {
        ArrayList<Integer>list = new ArrayList();
        Class<? extends ArrayList> clz = list.getClass();
        Method add = clz.getDeclaredMethod("add", Object.class);
       add.setAccessible(true);
        add.invoke(list, "kfc");
        System.out.println(list);
    }

}
